//
//  QSFNetManager.h
//  QSF_Dev
//
//  Created by Mr.Dynasty on 2018/5/24.
//  Copyright © 2018年 Mr.Dynasty. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>

typedef void (^QSFRequestSuccessBlock)(id data);
typedef void (^QSFRequestFailureBlock)(NSString *error);

@interface NetManager : AFHTTPSessionManager

+ (instancetype)shareManager;

- (NSURLSessionDataTask *)getWithUrl:(NSString *)urlString
                              params:(NSDictionary *)params
                             success:(QSFRequestSuccessBlock)success
                             failure:(QSFRequestFailureBlock)failure;

- (void)postWithUrl:(NSString *)urlString
             params:(NSDictionary *)params
            success:(QSFRequestSuccessBlock)success
            failure:(QSFRequestFailureBlock)failure;

- (void)uploadImageWithUrl:(NSString *)urlString
                    params:(NSDictionary *)params
                   success:(QSFRequestSuccessBlock)success
                   failure:(QSFRequestFailureBlock)failure;

- (void)patchWithUrl:(NSString *)urlString
              params:(NSDictionary *)params
             success:(QSFRequestSuccessBlock)success
             failure:(QSFRequestFailureBlock)failure;

@end
